package com.shy.commonutils.util;

import java.util.regex.Pattern;

/**
 * Created with Intellij IDEA.
 *
 * @Author: RinMi
 * @Date: 2022/08/18/21:55
 * @Description:
 */
public class UserInfoMatcher {

    public static final String REGEX_PHONE = "^1[3-9]\\d{9}$";
    public static final String REGEX_USERNAME = "^[a-zA-Z0-9]{6,20}$";

    public static boolean phoneMatcher(String phone) {
        return Pattern.matches(REGEX_PHONE, phone);
    }


    public static boolean UsernameMatcher(String username) {
        return Pattern.matches(REGEX_USERNAME, username);
    }
}
